# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=py3-aioquic
pkgver=0.9.24
pkgrel=0
pkgdesc="QUIC and HTTP/3 implementation in Python"
url="https://pypi.org/project/aioquic/"
arch="all"
license="BSD-3-Clause"
depends="
	py3-certifi
	py3-cryptography
	py3-openssl
	py3-pylsqpack
	py3-service_identity
	"
makedepends="
	openssl-dev
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/aiortc/aioquic/archive/$pkgver/py3-aioquic-$pkgver.tar.gz"
builddir="$srcdir/aioquic-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	find "$pkgdir" -name "*.c" -delete
}

sha512sums="
90069251a1d3481d26900190427e91b411e58878cbb9922fa4bcbe2a4288c35ac6b2602b8dfa242a44b1b760643f321649aa4d820cccc000d44744a52530c67e  py3-aioquic-0.9.24.tar.gz
"
